<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<title>SMART VE</title>
<link rel="stylesheet" href="resources/css/jquery.mobile-1.3.0.css" />
<link rel="stylesheet" href="resources/css/main.css" />
<script type="text/javascript" src="resources/js/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="resources/js/jquery.mobile-1.3.0.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
	$('.type').click(function(){
		var type = $('input[name=PROJECT_TYPE]:checked').val();
		var text = "";
		
		if(type=="smartVe"){
			text="VE 전 과정을 통한 아이디어 개발 및 평가 프로세스";
		}
		else if(type=="smartAhp"){
			text="AHP 기법을 통한 대상 별 우선순위 및 가중치 평가 프로세스";
		}
		else{
			text="브레인 스토밍을 통한 아이디어 창출 및 평가 프로세스";
		}
		$('p').html('<br/>'+text);
	
	});
	
	$('#PROJECT_CLOSE').click(function(){
		alert("비공개로 설정할 경우 프로젝트 완료 후 Project Key를 통해 다른 User들과 공유할 수 없습니다.");
	
	});

});
function newProject(){
	
	var projectName = $('#PROJECT_NAME').val();
	var memo=$('#PROJECT_MEMO').val();
	
	if(projectName==""){
		alert('프로젝트명을 입력해 주세요');
		return;
	}
	if(!$('input[name=PROJECT_TYPE]:checked').val()){
		alert('프로젝트 타입을 선택해주세요');
		return;
	}
	if(memo==""){
		alert('메모 해주세요');
		return;
	}
	if(!$('input[name=PROJECT_OPEN]:checked').val()){
		alert('공개여부를 선택해 주세요');
		return;
	}
	$('#projectForm').submit();
}
</script>
</head>

<body>
<form id="projectForm" action="project.do?action=insert" method="post">
<div id="wrapper" class="main" data-role="page">
	<div id="header" data-role="header" data-position="fixed" data-tap-toggle="false">
<!-- 2013-05-14 back, 확인 버튼 수정 -->
		<a href="javascript:history.back();" class="btn_back">back</a>
		<h1>New Project</h1>
		<a href="javascript:newProject();" class="ui-btn-right btn_right btn_round">확인</a>
<!-- 2013-05-14 수정 끝 -->
	</div>
	<div id="container" data-role="content" class="pnl_content">
		<div id="project_new" class="content">
			<label for="projectName" class="project_title">프로젝트명</label>
			<ul class="field">
				<li><input type="text" id="PROJECT_NAME" name="PROJECT_NAME" placeholder="Project Name" data-role="none" class="textform" /></li>
			</ul>
			<label for="projectType" class="project_title">프로젝트 타입</label>
			<ul class="field smart_type">
<!-- 2013-05-14 <span class="radio_img"> 추가 -->
				<li><span class="radio_img"><label for="smartVe" class="radio_tle">Smart VE</label> <input type="radio" id="smartVe" name="PROJECT_TYPE" value="SMART_VE" data-role="none" class="type" /></span></li>
				<li><span class="radio_img"><label for="smartAhp" class="radio_tle">Smart AHP</label> <input type="radio" id="smartAhp" name="PROJECT_TYPE" data-role="none" value="SMART_AHP" class="type" /></span></li>
				<li><span class="radio_img"><label for="smartIdea" class="radio_tle">Smart Idea</label> <input type="radio" id="smartIdea" name="PROJECT_TYPE" data-role="none" value="SMART_IDEA" class="type" /></span></li>
<!-- 2013-05-14 추가 끝 -->
			</ul>
			<p></p>	
			<div class="memo clfix">
				<label for="memo">Memo</label>
				<textarea id="PROJECT_MEMO" name="PROJECT_MEMO" cols="5" rows="1" data-role="none"></textarea>
			</div>
			<label for="choiceOpen" class="project_title">공개여부</label>
			<ul class="choice clfix">
<!-- 2013-05-14 <span class="radio_img"> 추가 -->
				<li><span class="radio_img"><input type="radio" id="open" value="y" name="PROJECT_OPEN" data-role="none" class="PROJECT_OPEN"/> <label for="open">공개</label></span></li>
				<li id="PROJECT_CLOSE" style="cursor:pointer;"><span class="radio_img" ><input type="radio" id="CLOSE" value="n" name="PROJECT_OPEN" data-role="none" class="PROJECT_OPEN" /> <label for="close" style="cursor:pointer;">비공개</label></span></li>
<!-- 2013-05-14 추가 끝 -->
			</ul>
		</div>
	</div>
</div>
</form>
</body>
<script type="text/javascript" src="resources/js/common.js"></script>
</html>